• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Maven compilation problem

 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didn't know where to post this issue, in Build tools or Struts. I am having a frustrating problem trying to compile my code with Maven against Struts 1.3.8. The code below compiles in Jdeveloper but not with mvn compile:

package com.enetrix.sis.util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.ForwardAction;

public class RedirectAction extends ForwardAction {

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
ActionForward forward = super.execute (mapping, form, request, response);
forward.setRedirect(true);
return forward;
}
}

Maven gives me "package org.apache.struts.actions does not exist" even though my pom specifies:

<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-core</artifactId>
<version>1.3.8</version>
<scope>compile</scope>
</dependency>

Anybody have any ideas?

eric
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Possibly a typo - should it be "action" and not "actions"? Or if you meant "actions", that package (org.apache.struts.actions) is not in struts-core, in which case you need another dependency. (I don't have struts or I would tell you which jar to depend on.)
 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for responding . . .

org.apache.struts.actions.ForwardAction

is correct. There is both action and actions.

Like I said, it compiled in Jdeveloper.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then JDeveloper must have automatically provided the correct set of JARs to the compiler. But this part of my advice still stands:

that package (org.apache.struts.actions) is not in struts-core, in which case you need another dependency

 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, I downloaded Struts 1.3.8 and found the missing class in struts-extras-1.3.8.jar, so that is the dependency you have to add.
 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Peter! I'll take my head out of my @#$% now.
 
reply
    Bookmark Topic Watch Topic
  • New Topic